/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package business;

import data.ReclamacaoData;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.sql.SQLException;

/**
 *
 * @author Mário
 */
public class Reclamacoes {

    ReclamacaoData data;

    public Reclamacoes(){
            data = new ReclamacaoData();
        }

    public void addReclamacao(int codCliente,String descricao) throws Exception {
        
        data.addReclamacao(codCliente, new GregorianCalendar(), descricao);
    }

    public ArrayList<Reclamacao> reclamacao_by_cliente(int codCliente) throws Exception {
       ArrayList<Reclamacao> recs = new ArrayList<Reclamacao>();
       for(Reclamacao rec : data.daReclamacoes()){
           if (rec.getCodCliente() == codCliente){
               recs.add(rec);
           }
       }
       return recs;
    }

}
